package concert;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * Created by jack on 18/5/29.
 */

@Aspect
@Component
public class Account_book {
    private int account = 0;

    @Pointcut("execution(* Vocal_concert.tips(int)) && args(tips)")
    public void add(int tips){}

    //为什么在这里不需要指定类型
    @Before("add(tips)")
    public void earning(int tips){
        account += tips;
    }

    public int getAccount() {
        return account;
    }
}
